﻿#pragma once

namespace Hazal
{
	class CTexture
	{
	public:

		virtual ~CTexture() = default;

	public:
		virtual uint32_t GetWidth() const = 0;

		virtual uint32_t GetHeight() const = 0;

		virtual uint32_t GetRendererID() const = 0;

		virtual void SetData(void* pData, uint32_t unSize) = 0;

		virtual void Bind(uint32_t unSlot = 0) const = 0;

		virtual void Unbind() const = 0;

		virtual bool operator==(const CTexture& rOther) const = 0;
	};

	class CTexture2D : public CTexture
	{
	public:
		virtual ~CTexture2D() {}

	public:
		/// <summary>
		/// 创建白色纹理
		/// </summary>
		/// <param name="unWidth">纹理宽度</param>
		/// <param name="unHeight">纹理高度</param>
		/// <returns></returns>
		static Ref<CTexture2D> Create(uint32_t unWidth, uint32_t unHeight);

		/// <summary>
		/// 创建基于指定文件的纹理
		/// </summary>
		/// <param name="strFilePath"></param>
		/// <returns></returns>
		static Ref<CTexture2D> Create(const std::string& strFilePath);
	};
}
